package cn.ava.ymcc.constants;

public class CommonConstants {

    // 发送短信相关常量字段
    public static class SmsConstant {
        // 发送短信UID名称
        public static final String SMS_UID = "Avavaava";
        // 短信接口密钥KEY
        public static final String SMS_KEY = "2A37CEA1C7716EB61C6BC1CE6A184F22";

    }

    public static class VerifyRegex{
        /**
         * 正则表达式：验证手机号
         */
        public static final String REGEX_MOBILE = "^((13[0-9])|(15[^4,\\D])|(16[0-9])|(18[0-9])|(17[0-9]))\\d{8}$";
        /**
         * 正则表达式：验证邮箱
         */
        public static final String REGEX_EMAIL = "^[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$";
    }


    // 用户相关的常量类
    public static class UserConstant {

        // 注册业务相关常量
        public static final String BUSINESS_REGISTER_KEY = "register:";

        // 微信注册绑定常量
        public static final String BUSINESS_BINDER_KEY = "binder:";

        // 登录业务相关常量
        public static final String BUSINESS_LOGIN_KEY = "login:";




    }

    // 微信相关的常量类
    public static class WeChatConstant {

        // 获取access_token的URL地址
        public static final String WECHART_TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
        public static final String WECHART_USERINFO_URL = "https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID";

        // 微信的appId
        public static final String WECHART_APPID = "wxd853562a0548a7d0";

        // 微信的密钥
        public static final String WECHART_SECRET = "4a5d5615f93f24bdba2ba8534642dbb6";

    }

    // token唯一标识相关常量
    public static class TokenConstant{
        // 订单防重token,用于存入redis中的key
        public static final String TOKEN_KEY = "token:%s:%s";
        // Security认证密码模式,获取Token令牌
        public static final String TOKEN_URL = "http://localhost:10030/oauth/token?client_id=%s&client_secret=%s&grant_type=password&username=%s&redirect_uri=http://www.baidu.com&password=%s";
        // 刷新token
        public static final String REFRESH_TOKEN = "http://localhost:10030/oauth/token?grant_type=refresh_token&refresh_token=%s&client_id=%s&client_secret=%s";
         // 客户端唯一标识
        public static final String CLIENT_ID = null;
        // 客户端秘钥
        public static final String SECRET = null;

    }

    /**
     * 课程状态相关常量
     */
    public static class CourseStateConstant{
        public static final Integer STATE_MINUS_ONE = -1;
        public static final Integer STATE_ZERO = 0;
        public static final Integer STATE_ONLINE = 1;
        public static final Integer STATE_TWO = 2;
        public static final Integer STATE_THREE = 3;
        public static final Integer STATE_FOUR = 4;
    }

    /**
     * 订单状态相关常量
     */
    public static class OrderPayState{
        public static final Integer STATE_WAIT = 0;
        public static final Integer STATE_SUCCESS = 1;
        public static final Integer STATE_CANCEL = 2;
        public static final Integer STATE_FAIL = 3;
    }


    /**
     * 订单支付类型相关常量
     */
    public static class OrderPayType{

        public static final Integer PAY_TYPE_BALANCE = 0;

        public static final Integer PAY_TYPE_ALIPAY = 1;

        public static final Integer PAY_TYPE_WECHATPAY = 2;

        public static final Integer PAY_TYPE_UNIONPAY = 3;
    }

    public static class KillCourseState{
        public static final Integer KILL_COUNT_ONE = 1;
        public static final Integer STATE_WAIT_PUBLISH = 0;
        public static final Integer STATE_PUBLISH = 1;
        public static final Integer STATE_CANCEL = 2;
    }
}
